<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
  <script>
    (function (){
      let Person = (function (){
        let _money = 100000;
        function Person(){}
        Person.prototype.buy = function (){
          _money -= 100;
          console.log(_money);
        }
        return Person;
      })()
      let teacher = new Person()
      teacher.buy()
      function wifeSearch(){
        teacher._money = 0
      }
      wifeSearch();
      teacher.buy()
    })()
  </script>
</body>
</html>